package com.boang;

import com.boang.dao.OrderDao;
import com.boang.po.Order;
import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;

import java.io.IOException;
import java.io.InputStream;
import java.util.List;

/*
  @author: 13813
  @date: 2024/7/22 16:26
*/
public class OneToOne {
    public static void main(String[] args) throws IOException {
        InputStream inputStream = Resources.getResourceAsStream("mybatis-config.xml");
        SqlSessionFactory sqlSessionFactory = new SqlSessionFactoryBuilder().build(inputStream);
        SqlSession sqlSession = sqlSessionFactory.openSession(true);
        OrderDao orderDao = sqlSession.getMapper(OrderDao.class);
        List<Order> orderList = orderDao.selectOrderListUser();
        System.out.println(orderList);
    }
}
